<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGiftRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gift_record', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('send_id')->comment('送礼用户id')->index();
            $table->integer('acc_id')->comment('收礼用户id')->index();
            $table->integer('gift_id')->comment('礼物id');
            $table->integer('num')->comment('赠送数量');
            $table->float('price')->comment('礼物单价');
            $table->float('discount')->comment('折扣')->nullable();
            $table->float('amount')->comment('合计金额')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('gift_record');
    }
}
